package pers.liyan.shi.springaop.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pers.liyan.shi.springaop.check.DepartmentAuthorityChecker;
import pers.liyan.shi.springaop.domain.Result;

@RestController
@RequestMapping("/api/department")
public class DepartmentController {

    @GetMapping("/test")
    @DepartmentAuthorityChecker
    public Result<String> test(@RequestParam(value = "username") String username, @RequestParam(value = "deptCode") String deptCode) {
        return Result.ok("OK");
    }

}
